<?php
namespace Home\Controller;
class LawyerScoreController extends CommonController{
	
	public function _initialize(){
		parent::_initialize();
		$this->user_id();
		$this->lawyer_is_role();
	}

	public function index(){
		$this->add_step('总评分');
		$this->lawyer_user_count = D('UserLawyer')->count();
		$list = D('UserLawyer')->field('user_id')->limit(1000)->order('total_avg_score desc')->select();
		$i = 1;
		$top_num = '--';
		foreach ($list as $rs) {
			if($rs['user_id'] == $this->user_id){
				$top_num = $i;
				break;
			}
			$i++;
		}
		$this->assign('lawyer_info', $this->user['lawyer_info']);
		$this->assign('top_num', $top_num);
		$this->display();
	}
	public function order_score(){
		$this->add_step('订单评分');

		$where['lawyer_user_id'] = $this->user_id;
		$list = D('Order')->get_list($where, '', $this->_get('p', '', 1));
		$this->page($list, D('Order')->count);
		$this->assign('list', $list);
		$this->display();
	}
}